package com.you.atlas.web.place.module.screen;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Navigator;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.you.atlas.biz.place.service.CollectService;
import com.you.common.webx.AuthContext;

public class CollectAdd {

    @Autowired
    private CollectService collectService;

    public void execute(@Param("placeId") Long placeId, Navigator navigator) {
        if (placeId == null) {
            navigator.redirectTo("homeModule");
            return;
        }
        collectService.createCollect(AuthContext.getContext().getMemberId(), placeId);
        navigator.redirectTo("placeModule").withTarget("placeView.vm").withParameter("id", placeId.toString());
    }
}
